App = new Backbone.Marionette.Application();
App.debug = true;
App.root  = '/meta'

App.addInitializer(function() {
	this.module('layoutModule').start({
      region: this.mainRegion
   });
});

App.addInitializer(function() {
	this.module('newdialogModule').start({
      region: this.newdialogRegion
   });
});

App.addInitializer(function() {
	this.module('tableModule').start({
      region: this.maincontainerRegion
   });
});

App.vent.on('layout:resized', function(){
	
});

App.vent.on('table:rendered', function(){
	console.log('Table:rendered event invoked');
	//this.module('layoutModule').resizeContainer()
});

App.on('initialize:before', function() {
	if (App.debug) console.log('App::initialize:before event invoked');
});
App.on('initialize:after', function() {
	if (App.debug) console.log('App::initialize:after event invoked');
});
App.on('start', function(options) {
	if (App.debug) console.log('App::start event invoked');
});

App.addRegions({
  mainRegion: '#main-container',
  newdialogRegion: '#dialogs',
  maincontainerRegion: '#center-panel'
});
